import { reactive } from "vue";

export default function ModalHook() {
	const dialogOpts = reactive<Base.DialogOpts>({
		visible: false,
		title: "",
		component: "PhoneInfo",
		passData: {},
		direction: "bottom",
		size: 500
	});
	// 点击查询具体某条数据的电话
	const showPhoneInfoHandle = (row: Base.CommonData) => {
		dialogOpts.title = "联系电话";
		dialogOpts.component = "PhoneInfo";
		dialogOpts.direction = "bottom";
		dialogOpts.size = "";
		dialogOpts.passData = row;
		dialogOpts.visible = true;
	};
	const initTipHandle = () => {
		dialogOpts.title = "";
		dialogOpts.component = "InitTip";
		dialogOpts.passData = {};
		dialogOpts.size = "80%";
		dialogOpts.direction = "center";
		dialogOpts.visible = true;
	};
	return {
		dialogOpts,
		showPhoneInfoHandle,
		initTipHandle
	};
}
